package com.example.a2032.db.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.example.a2032.entity.HeartRateData;

import java.util.List;

@Dao
public interface HeartRateDataDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(HeartRateData heartRateData);

    @Query("select * from HeartRateData")
    LiveData<List<HeartRateData>> loadAllHeartRate();

    @Query("select * from HeartRateData ORDER BY time DESC")
    LiveData<List<HeartRateData>> getLastHeartRateData();

    @Update
    void updateHeartRateData(HeartRateData heartRateData);


}
